var target = "src";
$(function() {
    $("#searchSrc").bind("click", search);
    $("#inner").load(iframeBind);
    $("#inner").hide();

});

function search() {

    $("#inner").attr("src", ctx + "/auth/pop/pop-authority.action");
    var height = parseInt($("div.ui-tabs-panel").css("height")) + 150;//$("div.ui-tabs-panel").css("margin-top");
    var width = parseInt($("div.ui-tabs-panel").css("width")) + 36;
    $("#inner").css({
        "width":"100%",
        "height":"100%",
        "border":$("div.ui-tabs-panel").css("border"),
        "background-color":"#f8f8f8",
        "border-style":"solid",
        "border-color":"#D7D7D7",
        "border-width":"1px",
        "border-top-width":"0px",
        "padding-top":"0px",
        "padding-right":"2px",
        "padding-left":"2px",
        "display":"block",
        "border-right-width":"0px"
    });
    $("#inner").show();
    var inputs = $("div.ui-tabs-panel").find(":input");
    inputs.attr("disabled", "disabled");
    BossUtils.resizeWindow();
}
function iframeBind() {
    var choose = $("#inner").contents().find("div.fbutton");//
    choose.bind("click", function() {
        var name = $("#inner").contents().find(":checked").parent("th").siblings("td").eq(1).find("div").eq(0).text();
        var authName = "AUTH_"+name;
        $("#authNames").val(authName);
        $("#inner").hide();
        $("div.ui-tabs-panel").find(":input").removeAttr("disabled");
    });
    var cancel = $("#inner").contents().find("a#frameClose").bind("click", function() {
        $("#inner").hide();
    });
}
